#include <hxcpp.h>

#ifndef INCLUDED_haxe_io_Input
#include <haxe/io/Input.h>
#endif
#ifndef INCLUDED_jax_io_JCloseable
#include <jax/io/JCloseable.h>
#endif
#ifndef INCLUDED_jax_io_JReader
#include <jax/io/JReader.h>
#endif
#ifndef INCLUDED_jax_lang_JAutoClosable
#include <jax/lang/JAutoClosable.h>
#endif
namespace jax{
namespace io{

Void JReader_obj::__construct(::haxe::io::Input ntv)
{
{
	HX_SOURCE_POS("Source/jax/io/JReader.hx",9)
	this->_native = ntv;
}
;
	return null();
}

JReader_obj::~JReader_obj() { }

Dynamic JReader_obj::__CreateEmpty() { return  new JReader_obj; }
hx::ObjectPtr< JReader_obj > JReader_obj::__new(::haxe::io::Input ntv)
{  hx::ObjectPtr< JReader_obj > result = new JReader_obj();
	result->__construct(ntv);
	return result;}

Dynamic JReader_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JReader_obj > result = new JReader_obj();
	result->__construct(inArgs[0]);
	return result;}

hx::Object *JReader_obj::__ToInterface(const type_info &inType) {
	if (inType==typeid( ::jax::io::JCloseable_obj)) return operator ::jax::io::JCloseable_obj *();
	if (inType==typeid( ::jax::lang::JAutoClosable_obj)) return operator ::jax::lang::JAutoClosable_obj *();
	return super::__ToInterface(inType);
}

Void JReader_obj::close( ){
{
		HX_SOURCE_PUSH("JReader_obj::close")
		HX_SOURCE_POS("Source/jax/io/JReader.hx",12)
		this->_native->close();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(JReader_obj,close,(void))

int JReader_obj::read( Dynamic f,Dynamic s,Dynamic t){
	HX_SOURCE_PUSH("JReader_obj::read")
	HX_SOURCE_POS("Source/jax/io/JReader.hx",15)
	if (((f == null()))){
		HX_SOURCE_POS("Source/jax/io/JReader.hx",17)
		return this->_native->readByte();
	}
	else{
		HX_SOURCE_POS("Source/jax/io/JReader.hx",19)
		return this->_native->readByte();
	}
	HX_SOURCE_POS("Source/jax/io/JReader.hx",15)
	return (int)0;
}


HX_DEFINE_DYNAMIC_FUNC3(JReader_obj,read,return )


JReader_obj::JReader_obj()
{
}

void JReader_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JReader);
	HX_MARK_MEMBER_NAME(_native,"_native");
	HX_MARK_END_CLASS();
}

void JReader_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(_native,"_native");
}

Dynamic JReader_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 4:
		if (HX_FIELD_EQ(inName,"read") ) { return read_dyn(); }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"close") ) { return close_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"_native") ) { return _native; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JReader_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 7:
		if (HX_FIELD_EQ(inName,"_native") ) { _native=inValue.Cast< ::haxe::io::Input >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JReader_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("_native"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("_native"),
	HX_CSTRING("close"),
	HX_CSTRING("read"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JReader_obj::__mClass,"__mClass");
};

Class JReader_obj::__mClass;

void JReader_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.io.JReader"), hx::TCanCast< JReader_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JReader_obj::__boot()
{
}

} // end namespace jax
} // end namespace io
